
class PizzaFactory {
	public enum PizzaType{HamAndMushroom,Deluxe,Hawaiian}
	public static Pizza createPizza(PizzaType pizzaType){
		switch(pizzaType){
			case HamAndMushroom: return new HamAndMushroomPizza();
			case Deluxe: return new DeluxePizza();
			case Hawaiian:return new HawaiianPizza();
		}
	throw new IllegalArgumentException("The pizza type "+pizzaType+" is not recognized.");
	}
}
